package bar.dark.lee.setting.sms.smsinsert;

import java.util.Calendar;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import android.util.Log;
import bar.dark.lee.BDConstents;
import bar.dark.lee.common.BDUtil;
import bar.dark.lee.setting.sms.InputData;

public class SmsOutMoney2 
{
	private int smsType; 
//	private boolean flagATM = false;
//	private boolean flagHalbu = false;
//	private String halbuMonth = "0";
//	
//	private boolean FLAG = true;
	private boolean available = false;
//	
//	private boolean outmoneyFlag = false;
//	
//	//1:check 2:credit
	private int checkcreditFlag = 0;
//	
	private final int CHECK = 1;
	private final int CREDIT = 2;
//	
	private String message;
	private InputData data;
//	
	private String date;
	
	public SmsOutMoney2(){};
	
	public SmsOutMoney2(InputData data, String message, String date, int smsType, int checkcreditFlag)
	{
		this.data = data;
		this.message = message;
		this.date = date;
		this.smsType = smsType;
		this.checkcreditFlag = checkcreditFlag;
		
		outMoney();
	}
	
	public boolean getAvailable()
	{
		return available;
	}
	
	public InputData getData()
	{
		return data;
	}
	
	public int getSmsType()
	{
		return smsType;
	}
	
	private void outMoney()
	{
		// 농협BC
		// 농협
		// 기업
		// 씨티
		// 삼성
		// 대구
		// 하나SK
		// 하나
		// 현대백화점
		
		
		if ( (data.getName().indexOf("농협BC") != -1) )
		{
			/*
			 * 				
				[체크.승인]
				8,400원
				농협BC(7*7*)이효준님
				12/08 22:59
				잔액22,129원
				서울대학교생활협동
				
				농협BC(1*2*)양선희님.01/04 12:38.일시불.10,000원.누적금액590,090원.메가박스씨너
				
				농협BC(0*5*)박*은님.05/08 15:15. 일시불27,900원.누적금액191,050원.퍼스트데이터코리아 유
			 */
			
			Pattern pName = Pattern.compile("(\\(\\d\\*\\d\\*\\))");
			Matcher mName = pName.matcher(message);
			Pattern pMoney = Pattern.compile("(\\d*,*\\d*,*\\d*,*\\d)원");
			Matcher mMoney = pMoney.matcher(message);
			Pattern pDate = Pattern.compile("(\\d{2}/\\d{2})");
			Matcher mDate = pDate.matcher(message);
			Pattern pMemo = Pattern.compile("\\d{2}:\\d{2}\\s+잔액-*\\d*,*\\d*,*\\d*,*\\d원\\s*(.+$)");
			Matcher mMemo = pMemo.matcher(message);
			Pattern pMemo2 = Pattern.compile("누적금액\\d*,*\\d*,*\\d*,*\\d원\\.(.+$)");
			Matcher mMemo2 = pMemo2.matcher(message);
			Pattern pMemo3 = Pattern.compile("님\\s+\\d{1,2}/\\d{1,2}\\s+\\d{2}:\\d{2}\\s+(.+$)");
			Matcher mMemo3 = pMemo3.matcher(message);
			Pattern pMemo4 = Pattern.compile("\\d*,*\\d*,*\\d*,*\\d원\\.[\\d*TOP적립예정\\.*]*(.+$)");
			Matcher mMemo4 = pMemo4.matcher(message);
			
			if (mName.find())
			{
				for (int i=0; i<mName.groupCount(); i++) 
				{
					data.setName(data.getName() + (mName.group(1)));
				}
			}
			else
			{
				available = false;
				return;
			}
			
			if (mMoney.find()) 
			{
				for (int i=0; i<mMoney.groupCount(); i++) 
				{
					data.setMoney((mMoney.group(1).replaceAll(",", "")));
				}
			}
			else
			{
				available = false;
				return;
			}
			
			Calendar calendar = Calendar.getInstance();
			if (date != null && date.length() > 0)
			{
				data.setDate(date);
			} 
			else if (mDate.find()) 
			{
				for (int i=0; i<mDate.groupCount(); i++) 
				{
					data.setDate(calendar.get(Calendar.YEAR)+(mDate.group(1).replaceAll("/", "")));
				}
			}
			else
			{
				data.setDate(BDUtil.getDateDB(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH)+1, calendar.get(Calendar.DAY_OF_MONTH)));
				//originalParsing();
			}
			
			if (mMemo.find()) 
			{
				for (int i=0; i<mMemo.groupCount(); i++) 
				{
					data.setMemo1(mMemo.group(1));
					data.setMemo2(mMemo.group(1));
					data.setMemo3(mMemo.group(1));
					data.setMemo4(mMemo.group(1));
				}
			}
			else if (mMemo2.find()) 
			{
				for (int i=0; i<mMemo2.groupCount(); i++) 
				{
					data.setMemo1(mMemo2.group(1));
					data.setMemo2(mMemo2.group(1));
					data.setMemo3(mMemo2.group(1));
					data.setMemo4(mMemo2.group(1));
				}
			}
			else if (mMemo3.find()) 
			{
				for (int i=0; i<mMemo3.groupCount(); i++) 
				{
					data.setMemo1(mMemo3.group(1));
					data.setMemo2(mMemo3.group(1));
					data.setMemo3(mMemo3.group(1));
					data.setMemo4(mMemo3.group(1));
				}
			}
			else if (mMemo4.find()) 
			{
				for (int i=0; i<mMemo4.groupCount(); i++) 
				{
					data.setMemo1(mMemo4.group(1));
					data.setMemo2(mMemo4.group(1));
					data.setMemo3(mMemo4.group(1));
					data.setMemo4(mMemo4.group(1));
				}
			}
			else
			{
				available = false;
				return;
			}
			
			available = true;
		}
		else if ( data.getName().equalsIgnoreCase("기업") || data.getName().equalsIgnoreCase("IBK기업은행") || data.getName().equalsIgnoreCase("기업은행"))
		{
			/*
			 * 체크후불교통 이용대금으로      4,950원이 당일 출금될 예정입니다 -IBK기업은행
			 * 
			 * 홍기준 님 체크후불교통 이용금액 20,730원이 당일 출금될 예정입니다 -기업은행
			 * 
			 * 01/23 20:31
				출금 14,000원	
				타누키돈부리
				020***86302019
				기업
				
				07/29 22:42
				출금 100,000원
				잔액 -*,***,***원
				곽수현
				485***11301010
				기업
			 */
			Pattern pName = Pattern.compile("(\\d{2,}\\*\\*\\*\\d{3,})");
			Matcher mName = pName.matcher(message);
			Pattern pName2 = Pattern.compile("체크후불교통");
			Matcher mName2 = pName2.matcher(message);
			Pattern pMoney = Pattern.compile("(\\d*,*\\d*,*\\d*,*\\d)원");
			Matcher mMoney = pMoney.matcher(message);
			Pattern pDate = Pattern.compile("(\\d{2}/\\d{2})");
			Matcher mDate = pDate.matcher(message);
			Pattern pMemo2 = Pattern.compile("체크후불교통\\s+이용금액");
			Matcher mMemo2 = pMemo2.matcher(message);
			Pattern pMemo = Pattern.compile("잔액\\s+-*\\d*,*\\d*,*\\d*,*\\d원\\s+(.+)\\s+\\d");
			Matcher mMemo = pMemo.matcher(message);
			Pattern pMemo3 = Pattern.compile("출금\\s+\\d*,*\\d*,*\\d*,*\\d원\\s+(.+)\\s+\\d");
			Matcher mMemo3 = pMemo3.matcher(message);
			
			if (mName.find())
			{
				for (int i=0; i<mName.groupCount(); i++) 
				{
					data.setName(data.getName() + "(" + (mName.group(1)) + ")");
				}
			}
			else if (mName2.find())
			{
				data.setName("기업 체크후불교통");
			}
			else
			{
				available = false;
				return;
			}
			
			if (mMoney.find()) 
			{
				for (int i=0; i<mMoney.groupCount(); i++) 
				{
					data.setMoney((mMoney.group(1).replaceAll(",", "")));
				}
			}
			else
			{
				available = false;
				return;
			}
			
			Calendar calendar = Calendar.getInstance();
			if (date != null && date.length() > 0)
			{
				data.setDate(date);
			} 
			else if (mDate.find()) 
			{
				for (int i=0; i<mDate.groupCount(); i++) 
				{
					data.setDate(calendar.get(Calendar.YEAR)+(mDate.group(1).replaceAll("/", "")));
				}
			}
			else
			{
				data.setDate(BDUtil.getDateDB(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH)+1, calendar.get(Calendar.DAY_OF_MONTH)));
				//originalParsing();
			}
			
			if (mMemo2.find()) 
			{
				data.setMemo1(data.getDate().substring(4,6) + "월 후불교통대금");
				data.setMemo2(data.getDate().substring(4,6) + "월 후불교통대금");
				data.setMemo3(data.getDate().substring(4,6) + "월 후불교통대금");
				data.setMemo4(data.getDate().substring(4,6) + "월 후불교통대금");
			}
			else if (mMemo.find()) 
			{
				for (int i=0; i<mMemo.groupCount(); i++) 
				{
					data.setMemo1(mMemo.group(1));
					data.setMemo2(mMemo.group(1));
					data.setMemo3(mMemo.group(1));
					data.setMemo4(mMemo.group(1));
				}
			}
			else if (mMemo3.find()) 
			{
				for (int i=0; i<mMemo3.groupCount(); i++) 
				{
					data.setMemo1(mMemo3.group(1));
					data.setMemo2(mMemo3.group(1));
					data.setMemo3(mMemo3.group(1));
					data.setMemo4(mMemo3.group(1));
				}
			}
			else
			{
				available = false;
				return;
			}
			
			available = true;
		}
		else if ( (data.getName().equalsIgnoreCase("씨티카드") ) )
		{
			/*
			 * 씨티카드(1*3*)
				홍길동님
				09/05 18:01
				일시불 5,000월
				누계 100,000원
				김밥천국
				
				씨티카드(6*9*)
				양승만님
				09/04 13:55
				일시불 2,500원
				누계 564,147원
				스타벅스커피코
				
				
				씨티카드(0*0*)
				ㅡㅡㅡ님
				09/28 10:46
				일시불 56,000원
				누계 100,000원
				웅진씽크빅
				
				씨티카드(2*8*)
				홍길동님
				01/26 15:20
				일시불 13,000원
				롯데리아
			 * 
			 */
			Pattern pName = Pattern.compile("(\\(\\d\\*\\d\\*\\))");
			Matcher mName = pName.matcher(message);
			Pattern pMoney = Pattern.compile("\\W+(\\d*,*\\d*,*\\d*,*\\d)원");
			Matcher mMoney = pMoney.matcher(message);
			Pattern pDate = Pattern.compile("([\\d]{2}[/][\\d]{2})");
			Matcher mDate = pDate.matcher(message);
			Pattern pMemo = Pattern.compile("누계\\s+\\d*,*\\d*,*\\d*,*\\d원\\s+(.+)\\s*");	// ???원 뒤에
			Matcher mMemo = pMemo.matcher(message);
			Pattern pMemo2 = Pattern.compile("\\d*,*\\d*,*\\d*,*\\d원\\s+(.+)\\s*");	// ???원 뒤에
			Matcher mMemo2 = pMemo2.matcher(message);
			
			if (mName.find())
			{
				for (int i=0; i<mName.groupCount(); i++) 
				{
					data.setName(data.getName() + (mName.group(1)));
				}
			}
			else
			{
				available = false;
				return;
			}
			
			if (mMoney.find()) 
			{
				for (int i=0; i<mMoney.groupCount(); i++) 
				{
					data.setMoney((mMoney.group(1).replaceAll(",", "")));
				}
			}
			else
			{
				available = false;
				return;
			}
			
			Calendar calendar = Calendar.getInstance();
			if (date != null && date.length() > 0)
			{
				data.setDate(date);
			} 
			else if (mDate.find()) 
			{
				for (int i=0; i<mDate.groupCount(); i++) 
				{
					data.setDate(calendar.get(Calendar.YEAR)+(mDate.group(1).replaceAll("/", "")));
				}
			}
			else
			{
				data.setDate(BDUtil.getDateDB(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH)+1, calendar.get(Calendar.DAY_OF_MONTH)));
				//originalParsing();
			}
			
			if (mMemo.find()) 
			{
				for (int i=0; i<mMemo.groupCount(); i++) 
				{
					data.setMemo1((mMemo.group(1)));
					data.setMemo2((mMemo.group(1)));
					data.setMemo3((mMemo.group(1)));
					data.setMemo4((mMemo.group(1)));
				}
			}
			else if (mMemo2.find()) 
			{
				for (int i=0; i<mMemo2.groupCount(); i++) 
				{
					data.setMemo1((mMemo2.group(1)));
					data.setMemo2((mMemo2.group(1)));
					data.setMemo3((mMemo2.group(1)));
					data.setMemo4((mMemo2.group(1)));
				}
			}
			else
			{
				available = false;
				return;
			}
			
			available = true;
		}
		else if ( (data.getName().indexOf("삼성카드") != -1) )
		{
			/*
			 * 삼성카드
				08/20 00:13
				1.0% 보너스클럽
				(주)교보문고
				36,000원

				(삼성카드) 
				08월분 후불교통 
				(버스+지하철) 
				사용합계 
				0원 입니다.
				
				(삼성카드) 
				자동결제 
				07/12 
				ＳＫ통신료 
				0원 
				일시불
				
				삼성카드 
				해외승인 
				09/20 09:33 
				THE RITZ-CARLTON JAKAR\JL 
				IDR 5756762.00 
				감사합니다
				
				삼성카드승인
				10/16 14:24
				8,900원
				일시불
				옥션(1588-0184)
				*누적
				1,506,911원
				
				삼성카드승인 
				05/25 16:32 
				4,500원 
				일시불 
				씨유서면중앙점
				
				삼성카드승인김기*님
				03/11 18:24
				4,212원
				일시불
				주식회사남전상사
				누적4,212
				
				삼성카드승인이효*님
				03/09 10:59
				비지에프리
				81,000원
				일시불
				감사합니다
			 */
			Pattern pMoney = Pattern.compile("\\s+(\\d*,*\\d*,*\\d*,*\\d)원");
			Matcher mMoney = pMoney.matcher(message);
			Pattern pDate = Pattern.compile("([\\d]{2}[/][\\d]{2})");
			Matcher mDate = pDate.matcher(message);
			Pattern pMemo = Pattern.compile("\\d{2,}:\\d{2,}\\s+[\\d*\\.*\\d*%* 보너스클럽\\s]*(.+)\\s+\\d*,*\\d*,*\\d*,*\\d원");	
			Matcher mMemo = pMemo.matcher(message);
			Pattern pMemo2 = Pattern.compile("(\\d{1,2}월분 후불교통)");	
			Matcher mMemo2 = pMemo2.matcher(message);
			Pattern pMemo3 = Pattern.compile("자동결제\\s+\\d{1,2}/\\d{1,2}\\s+(.+)\\s+\\d*,*\\d*,*\\d*,*\\d원");	
			Matcher mMemo3 = pMemo3.matcher(message);
			Pattern pMemo5 = Pattern.compile("\\d*,*\\d*,*\\d*,*\\d원\\s+(.+)\\s+\\**누적");	
			Matcher mMemo5 = pMemo5.matcher(message);
			Pattern pMemo6 = Pattern.compile("\\d{1,2}:\\d{1,2}\\s+(.+)\\s+\\d*,*\\d*,*\\d*,*\\d원\\s+");	
			Matcher mMemo6 = pMemo6.matcher(message);
			Pattern pMemo4 = Pattern.compile("\\d*,*\\d*,*\\d*,*\\d원\\s+(.+$)");	
			Matcher mMemo4 = pMemo4.matcher(message);
			
			if (mMoney.find()) 
			{
				for (int i=0; i<mMoney.groupCount(); i++) 
				{
					data.setMoney((mMoney.group(1).replaceAll(",", "")));
				}
			}
			else
			{
				available = false;
				return;
			}
			
			Calendar calendar = Calendar.getInstance();
			if (date != null && date.length() > 0)
			{
				data.setDate(date);
			} 
			else if (mDate.find()) 
			{
				for (int i=0; i<mDate.groupCount(); i++) 
				{
					data.setDate(calendar.get(Calendar.YEAR)+(mDate.group(1).replaceAll("/", "")));
				}
			}
			else
			{
				data.setDate(BDUtil.getDateDB(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH)+1, calendar.get(Calendar.DAY_OF_MONTH)));
				//originalParsing();
			}
			
			if (mMemo5.find()) 
			{
				for (int i=0; i<mMemo5.groupCount(); i++) 
				{
					data.setMemo1((mMemo5.group(1)));
					data.setMemo2((mMemo5.group(1)));
					data.setMemo3((mMemo5.group(1)));
					data.setMemo4((mMemo5.group(1)));
				}
			}
			else if (mMemo6.find()) 
			{
				for (int i=0; i<mMemo6.groupCount(); i++) 
				{
					data.setMemo1((mMemo6.group(1)));
					data.setMemo2((mMemo6.group(1)));
					data.setMemo3((mMemo6.group(1)));
					data.setMemo4((mMemo6.group(1)));
				}
			}
			else if (mMemo4.find()) 
			{
				for (int i=0; i<mMemo4.groupCount(); i++) 
				{
					data.setMemo1((mMemo4.group(1)));
					data.setMemo2((mMemo4.group(1)));
					data.setMemo3((mMemo4.group(1)));
					data.setMemo4((mMemo4.group(1)));
				}
			}
			else if (mMemo.find()) 
			{
				for (int i=0; i<mMemo.groupCount(); i++) 
				{
					data.setMemo1((mMemo.group(1)));
					data.setMemo2((mMemo.group(1)));
					data.setMemo3((mMemo.group(1)));
					data.setMemo4((mMemo.group(1)));
				}
			}
			else if (mMemo2.find()) 
			{
				for (int i=0; i<mMemo2.groupCount(); i++) 
				{
					data.setMemo1((mMemo2.group(1)));
					data.setMemo2((mMemo2.group(1)));
					data.setMemo3((mMemo2.group(1)));
					data.setMemo4((mMemo2.group(1)));
				}
			}
			else if (mMemo3.find()) 
			{
				for (int i=0; i<mMemo3.groupCount(); i++) 
				{
					data.setMemo1((mMemo3.group(1)));
					data.setMemo2((mMemo3.group(1)));
					data.setMemo3((mMemo3.group(1)));
					data.setMemo4((mMemo3.group(1)));
				}
			}
			else
			{
				available = false;
				return;
			}
			
			available = true;
		}
		else if ( data.getName().equalsIgnoreCase("삼성증권") )
		{
			/*
			 * 나의 [삼성증권] 23:43 
				5990***6투신 CMA 
				출금 1,500 
				잔액 74,710 
				체크카드출금
			 */
			Pattern pName = Pattern.compile("\\d{1,2}:\\d{1,2}\\s+(\\d{2,}\\*{1,}\\d{1})");
			Matcher mName = pName.matcher(message);
			Pattern pMoney = Pattern.compile("출금\\s+(\\d*,*\\d*,*\\d*,*\\d)\\s+");
			Matcher mMoney = pMoney.matcher(message);
			Pattern pDate = Pattern.compile("(\\d{1,2}/\\d{1,2})");
			Matcher mDate = pDate.matcher(message);
			Pattern pMemo = Pattern.compile("잔액\\s+-*\\d*,*\\d*,*\\d*,*\\d\\s+(.+$)");
			Matcher mMemo = pMemo.matcher(message);
			Pattern pMemo2 = Pattern.compile("출금\\s+\\d*,*\\d*,*\\d*,*\\d\\s+(.+$)");
			Matcher mMemo2 = pMemo2.matcher(message);
			
			if (mName.find())
			{
				data.setName("삼성증권(" + mName.group(1) + ")");
			}
			else
			{
				available = false;
				return;
			}
			
			if (mMoney.find()) 
			{
				for (int i=0; i<mMoney.groupCount(); i++) 
				{
					data.setMoney((mMoney.group(1).replaceAll(",", "")));
				}
			}
			else
			{
				available = false;
				return;
			}
			
			Calendar calendar = Calendar.getInstance();
			if (date != null && date.length() > 0)
			{
				data.setDate(date);
			} 
			else if (mDate.find()) 
			{
				for (int i=0; i<mDate.groupCount(); i++) 
				{
					data.setDate(calendar.get(Calendar.YEAR)+(mDate.group(1)) + (mDate.group(2)));
				}
			}
			else
			{
				data.setDate(BDUtil.getDateDB(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH)+1, calendar.get(Calendar.DAY_OF_MONTH)));
			}
			
			if (mMemo.find()) 
			{
				for (int i=0; i<mMemo.groupCount(); i++) 
				{
					data.setMemo1(mMemo.group(1));
					data.setMemo2(mMemo.group(1));
					data.setMemo3(mMemo.group(1));
					data.setMemo4(mMemo.group(1));
				}
			}
			else if (mMemo2.find()) 
			{
				for (int i=0; i<mMemo2.groupCount(); i++) 
				{
					data.setMemo1(mMemo2.group(1));
					data.setMemo2(mMemo2.group(1));
					data.setMemo3(mMemo2.group(1));
					data.setMemo4(mMemo2.group(1));
				}
			}
			else
			{
				available = false;
				return;
			}
			
			available = true;
		}
		else if ( (data.getName().indexOf("NH카드") != -1) )
		{
			/*
			 * 
			 * [체크승인]
				12,950원
				NH카드(2*2*)
				김지영님
				04/19 16:45
				다연홈마트


			 * [일시불승인]
				14,400원
				NH카드(****)
				***님
				09/04 18:45
				누적금액 573,865원
				KFC수
				
				[일시불승인]
				20,000원
				NH카드(8055)
				공용카드님
				01/26 11:12
				용인IC주유소
				
				NH카드(9*3*)
				신용승인
				39,800원
				국지수님
				03/06 19:45
				누계 39,800원
				KCP-쿠팡
			 * 
			 */
			Pattern pName = Pattern.compile("NH카드\\((.{4})\\)");
			Matcher mName = pName.matcher(message);
			Pattern pMoney = Pattern.compile("(\\d*,*\\d*,*\\d*,*\\d)원\\s+NH카드");
			Matcher mMoney = pMoney.matcher(message);
			Pattern pDate = Pattern.compile("([\\d]{2}[/][\\d]{2})");
			Matcher mDate = pDate.matcher(message);
			Pattern pMemo = Pattern.compile("누적금액\\s+\\d*,*\\d*,*\\d*,*\\d원\\s+(.+)\\s*");
			Matcher mMemo = pMemo.matcher(message);
			Pattern pMemo3 = Pattern.compile("누계\\s+\\d*,*\\d*,*\\d*,*\\d원\\s+(.+)\\s*");
			Matcher mMemo3 = pMemo3.matcher(message);
			Pattern pMemo2 = Pattern.compile("\\d{1,2}:\\d{1,2}\\s+(.+$)");
			Matcher mMemo2 = pMemo2.matcher(message);
			
			if (mName.find())
			{
				if (checkcreditFlag == CHECK)
				{
					for (int i=0; i<mName.groupCount(); i++) 
					{
						data.setName(data.getName() + "(" + (mName.group(1)) + "-체크)");
					}
				}
				else if (checkcreditFlag == CREDIT)
				{
					for (int i=0; i<mName.groupCount(); i++) 
					{
						data.setName(data.getName() + "(" + (mName.group(1)) + "-신용)");
					}
				}
			}
			else
			{
				available = false;
				return;
			}
			
			if (mMoney.find()) 
			{
				for (int i=0; i<mMoney.groupCount(); i++) 
				{
					data.setMoney((mMoney.group(1).replaceAll(",", "")));
				}
			}
			else
			{
				available = false;
				return;
			}
			
			Calendar calendar = Calendar.getInstance();
			if (date != null && date.length() > 0)
			{
				data.setDate(date);
			} 
			else if (mDate.find()) 
			{
				for (int i=0; i<mDate.groupCount(); i++) 
				{
					data.setDate(calendar.get(Calendar.YEAR)+(mDate.group(1).replaceAll("/", "")));
				}
			}
			else
			{
				data.setDate(BDUtil.getDateDB(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH)+1, calendar.get(Calendar.DAY_OF_MONTH)));
				//originalParsing();
			}
			
			if (mMemo.find()) 
			{
				for (int i=0; i<mMemo.groupCount(); i++) 
				{
					data.setMemo1((mMemo.group(1)));
					data.setMemo2((mMemo.group(1)));
					data.setMemo3((mMemo.group(1)));
					data.setMemo4((mMemo.group(1)));
				}
			}
			if (mMemo3.find()) 
			{
				for (int i=0; i<mMemo3.groupCount(); i++) 
				{
					data.setMemo1((mMemo3.group(1)));
					data.setMemo2((mMemo3.group(1)));
					data.setMemo3((mMemo3.group(1)));
					data.setMemo4((mMemo3.group(1)));
				}
			}
			else if (mMemo2.find()) 
			{
				for (int i=0; i<mMemo2.groupCount(); i++) 
				{
					data.setMemo1((mMemo2.group(1)));
					data.setMemo2((mMemo2.group(1)));
					data.setMemo3((mMemo2.group(1)));
					data.setMemo4((mMemo2.group(1)));
				}
			}
			else
			{
				available = false;
				return;
			}
			
			available = true;
		}
		else if (data.getName().equalsIgnoreCase("농협"))
		{
			/*
			 * 농협 2012/08/26 741011-56-129*** 100,000원(윤은희)출금.잔액558,238원
			 * 농협 2012/09/04 814-12-035*** 5,900원(우리들북구청)출금.잔액782,698원
			 * 농협 2012/05/14 301-0002-7139-** 18,540원(홀세일마트)
			 * 
			 * 농협 611-02-397*** 16,362원(삼성생명약대)31일 자동출금처리
			 * 농협 211018-52-050*** 19,900원(제일아쿠아)26일 자동출금처리.잔액 117,622원
			 * 
			 * 
			 * 농협 2012/09/03 643-12-095*** 50,000원( 042-5003)출금.잔액499,053원 	// atm기 현금 출금
			 * 
			 * 농협)10:33 xx님이 xxx님의 신한계좌로 xx,xxx원 송금함
			 * 
			 * 농협 2013/01/24 352-0289-1439-** 6,050원(교보핫트랙스)출금.잔액133,740원
			 */
			Pattern pName = Pattern.compile("(\\d{2,}-\\d{1,}-\\d{1,})");
			Matcher mName = pName.matcher(message);
			Pattern pName2 = Pattern.compile("\\d{1,2}:\\d{1,2}\\s+(.+)님이\\s+.+님의\\s+.+계좌로");
			Matcher mName2 = pName2.matcher(message);
			Pattern pMoney = Pattern.compile("(\\d*,*\\d*,*\\d*,*\\d)원");
			Matcher mMoney = pMoney.matcher(message);
			Pattern pDate = Pattern.compile("(\\d{4}/\\d{2}/\\d{2})");
			Matcher mDate = pDate.matcher(message);
			Pattern pDate2 = Pattern.compile("\\)(\\d{1,2})일");
			Matcher mDate2 = pDate2.matcher(message);
			Pattern pMemo = Pattern.compile("\\d원\\s*\\((.+)\\)출금");
			Matcher mMemo = pMemo.matcher(message);
			Pattern pMemo2 = Pattern.compile("\\d원\\s*\\((.+)\\)");
			Matcher mMemo2 = pMemo2.matcher(message);
			Pattern pMemo4 = Pattern.compile(":\\d{1,2}\\s+(.+님이\\s+.+님의\\s+.+계좌로\\s+\\d*,*\\d*,*\\d*,*\\d원)");
			Matcher mMemo4 = pMemo4.matcher(message);
			
			if (mName.find())
			{
				for (int i=0; i<mName.groupCount(); i++) 
				{
					data.setName(data.getName() + "(" + (mName.group(1)).replaceAll("-", "") + ")");
				}
			}
			else if (mName2.find())
			{
				for (int i=0; i<mName2.groupCount(); i++) 
				{
					data.setName("농협(" + mName2.group(1) + ")");
				}
			}
			else
			{
				available = false;
				return;
			}
			
			if (mMoney.find()) 
			{
				for (int i=0; i<mMoney.groupCount(); i++) 
				{
					data.setMoney((mMoney.group(1).replaceAll(",", "")));
				}
			}
			else
			{
				available = false;
				return;
			}
			
			Calendar calendar = Calendar.getInstance();
			if (mDate2.find()) 
			{
				for (int i=0; i<mDate2.groupCount(); i++) 
				{
					if (date != null && date.length() > 0)
					{
						data.setDate(date.substring(0, 6) + mDate2.group(1));
					}
					else
					{
						data.setDate( (BDUtil.getDateDB(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH)+1, calendar.get(Calendar.DAY_OF_MONTH))).substring(0, 6) + mDate2.group(1) );
					}
				}
			}
			else if (date != null && date.length() > 0)
			{
				data.setDate(date);
			} 
			else if (mDate.find()) 
			{
				for (int i=0; i<mDate.groupCount(); i++) 
				{
					data.setDate(mDate.group(1).replaceAll("/", ""));
				}
			}
			else
			{
				data.setDate(BDUtil.getDateDB(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH)+1, calendar.get(Calendar.DAY_OF_MONTH)));
				//originalParsing();
			}
			
			if (mMemo.find()) 
			{
				for (int i=0; i<mMemo.groupCount(); i++) 
				{
					Pattern pMemo3 = Pattern.compile("\\d{3}-\\d{4}");
					Matcher mMemo3 = pMemo3.matcher(mMemo.group(1));
					
					if (mMemo3.find())
					{
						data.setMemo1("현금 출금");
						data.setMemo2("현금 출금");
						data.setMemo3("현금 출금");
						data.setMemo4("현금 출금");
						
						smsType = BDConstents.OUT_ATM_SMS;
					}
					else
					{
						data.setMemo1((mMemo.group(1)));
						data.setMemo2((mMemo.group(1)));
						data.setMemo3((mMemo.group(1)));
						data.setMemo4((mMemo.group(1)));
					}
				}
			}
			else if (mMemo2.find()) 
			{
				for (int i=0; i<mMemo2.groupCount(); i++) 
				{
					data.setMemo1((mMemo2.group(1)));
					data.setMemo2((mMemo2.group(1)));
					data.setMemo3((mMemo2.group(1)));
					data.setMemo4((mMemo2.group(1)));
				}
			}
			else if (mMemo4.find()) 
			{
				for (int i=0; i<mMemo4.groupCount(); i++) 
				{
					data.setMemo1((mMemo4.group(1)));
					data.setMemo2((mMemo4.group(1)));
					data.setMemo3((mMemo4.group(1)));
					data.setMemo4((mMemo4.group(1)));
				}
			}
			else
			{
				available = false;
				return;
			}
			
			available = true;
		}
		else if (data.getName().equalsIgnoreCase("기타매체출금") || data.getName().equalsIgnoreCase("자동이체출금")
				|| data.getName().equalsIgnoreCase("인터넷출금") || data.getName().equalsIgnoreCase("CD/ATM출금")
				|| data.getName().equalsIgnoreCase("스마트출금"))
		{
			/*
			 * 
			 * 자동이체출금 문자통지수수료님에게 123,123원 지급, 잔액:123,123(06513**7547)13:13:13
			 * 
			 * 자동이체출금 01094910617SKT님에게 119,070원 지급, 잔액 : 480,936(04713**9467)03:22:53
			 * 
			 * 자동이체출금
				신한카드님에게
				153,199원이
				지급되었습니다12:06:19(07908*62113)
				
				자동이체출금
				52110*22425계좌로
				60,000원이
				지급되었습니다17:55:11(07908*62113)
			 * 
			 */
			Pattern pName = Pattern.compile("\\d{2}:\\d{2}:\\d{2}\\((.+)\\)");
			Matcher mName = pName.matcher(message);
			Pattern pName2 = Pattern.compile("\\((.+)\\)\\d{2}:\\d{2}:\\d{2}");
			Matcher mName2 = pName2.matcher(message);
			Pattern pMoney = Pattern.compile("\\W+(\\d*,*\\d*,*\\d*,*\\d)원");
			Matcher mMoney = pMoney.matcher(message);
//			Pattern pDate = Pattern.compile("\\d{4}/(\\d{2}/\\d{2})");
//			Matcher mDate = pDate.matcher(message);
			Pattern pMemo = Pattern.compile("기타매체출금\\s+(.+)[님|로]");
			Matcher mMemo = pMemo.matcher(message);
			Pattern pMemo2 = Pattern.compile("자동이체출금\\s+(.+)[님|로]");
			Matcher mMemo2 = pMemo2.matcher(message);
			Pattern pMemo3 = Pattern.compile("인터넷출금\\s+(.+)[님|로]");
			Matcher mMemo3 = pMemo3.matcher(message);
			Pattern pMemo4 = Pattern.compile("스마트출금\\s+(.+)[님|로]");
			Matcher mMemo4 = pMemo4.matcher(message);
			
			if (mName.find())
			{
				for (int i=0; i<mName.groupCount(); i++) 
				{
					data.setName("대구" + "(" + (mName.group(1)) + ")");
				}
			}
			else if (mName2.find())
			{
				for (int i=0; i<mName2.groupCount(); i++) 
				{
					data.setName("대구" + "(" + (mName2.group(1)) + ")");
				}
			}
			else
			{
				available = false;
				return;
			}
			
			if (mMoney.find()) 
			{
				for (int i=0; i<mMoney.groupCount(); i++) 
				{
					data.setMoney((mMoney.group(1).replaceAll(",", "")));
				}
			}
			else
			{
				available = false;
				return;
			}
			
			Calendar calendar = Calendar.getInstance();
			if (date != null && date.length() > 0)
			{
				data.setDate(date);
			} 
			else
			{
				data.setDate(BDUtil.getDateDB(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH)+1, calendar.get(Calendar.DAY_OF_MONTH)));
			}
			
			if (mMemo.find()) 
			{
				for (int i=0; i<mMemo.groupCount(); i++) 
				{
					data.setMemo1((mMemo.group(1)));
					data.setMemo2((mMemo.group(1)));
					data.setMemo3((mMemo.group(1)));
					data.setMemo4((mMemo.group(1)));
				}
			}
			else if (mMemo2.find()) 
			{
				for (int i=0; i<mMemo2.groupCount(); i++) 
				{
					data.setMemo1((mMemo2.group(1)));
					data.setMemo2((mMemo2.group(1)));
					data.setMemo3((mMemo2.group(1)));
					data.setMemo4((mMemo2.group(1)));
				}
			}
			else if (mMemo3.find()) 
			{
				for (int i=0; i<mMemo3.groupCount(); i++) 
				{
					data.setMemo1((mMemo3.group(1)));
					data.setMemo2((mMemo3.group(1)));
					data.setMemo3((mMemo3.group(1)));
					data.setMemo4((mMemo3.group(1)));
				}
			}
			else if (mMemo4.find()) 
			{
				for (int i=0; i<mMemo4.groupCount(); i++) 
				{
					data.setMemo1((mMemo4.group(1)));
					data.setMemo2((mMemo4.group(1)));
					data.setMemo3((mMemo4.group(1)));
					data.setMemo4((mMemo4.group(1)));
				}
			}
			else
			{
				Pattern pMemo9 = Pattern.compile("CD/ATM");
				Matcher mMemo9 = pMemo9.matcher(message);
				
				if (mMemo9.find())
				{
					data.setMemo1("현금 출금");
					data.setMemo2("현금 출금");
					data.setMemo3("현금 출금");
					data.setMemo4("현금 출금");
					
					smsType = BDConstents.OUT_ATM_SMS;
				}
				else
				{
					available = false;
					return;
				}
			}
			
			available = true;
		}
		else if ( data.getName().equalsIgnoreCase("하나SK"))
		{
			/*
				하나SK(6*4*)정*경님 09/03 15:12 스튜디오 할부/350,000원/누적1,094,372원
				하나SK(4*7*)김*웅님 09/03 12:41 송파 CAF 일시불/21,900원/누적729,620원
				하나SK(3*0*)임*애님 09/04 12:58 11번가 일시불/24,480원/누적376,940원
				하나SK(4*7*)김*웅님 09/03 12:35 돈정돈까 일시불/67,000원/누적707,720원
				하나SK(2*8*)김*진님 12/11 11:53 연합메디 일시불/4,300원/누적653,510원
			*/ 
			Pattern pName = Pattern.compile("(\\(\\d\\*\\d\\*\\))");
			Matcher mName = pName.matcher(message);
			Pattern pMoney = Pattern.compile("(\\d*,*\\d*,*\\d*,*\\d)원");
			Matcher mMoney = pMoney.matcher(message);
			Pattern pDate = Pattern.compile("([\\d]{2}[/][\\d]{2})");
			Matcher mDate = pDate.matcher(message);
			Pattern pMemo = Pattern.compile("\\d{1,2}:\\d{1,2}\\s+(.+\\s?.+)\\s+/\\d");
			Matcher mMemo = pMemo.matcher(message);
			
			if (mName.find())
			{
				for (int i=0; i<mName.groupCount(); i++) 
				{
					data.setName(data.getName() + (mName.group(1)));
				}
			}
			else
			{
				available = false;
				return;
			}
			
			if (mMoney.find()) 
			{
				for (int i=0; i<mMoney.groupCount(); i++) 
				{
					data.setMoney((mMoney.group(1).replaceAll(",", "")));
				}
			}
			else
			{
				available = false;
				return;
			}
			
			Calendar calendar = Calendar.getInstance();
			if (date != null && date.length() > 0)
			{
				data.setDate(date);
			} 
			else if (mDate.find()) 
			{
				for (int i=0; i<mDate.groupCount(); i++) 
				{
					data.setDate(calendar.get(Calendar.YEAR)+(mDate.group(1).replaceAll("/", "")));
				}
			}
			else
			{
				data.setDate(BDUtil.getDateDB(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH)+1, calendar.get(Calendar.DAY_OF_MONTH)));
			}
			
			if (mMemo.find()) 
			{
				for (int i=0; i<mMemo.groupCount(); i++) 
				{
					data.setMemo1((mMemo.group(1)));
					data.setMemo2((mMemo.group(1)));
					data.setMemo3((mMemo.group(1)));
					data.setMemo4((mMemo.group(1)));
				}
			}
			else
			{
				available = false;
				return;
			}
			
			available = true;
		}
		else if ( data.getName().equalsIgnoreCase("하나SK체크카드") || data.getName().equalsIgnoreCase("하나SK카드"))
		{
			/*
			 * 하나SK카드(1*3*)신*진님 01/20 17:27 일시불/ 61,500원/승인/ 롯데마트대구점
			 * 
			 * 하나SK카드(3*9*)김*우님01/25 12:08 일시불/60,000원/승인, 4,500원/할인 SK네트웍스
			 * 
			 * 하나SK체크카드(0*7*)김*식님 01/31 00:49 일시불/ 9,000원(P142점)/승인/ 이니시스_
			 */
			Pattern pName = Pattern.compile("(\\(\\d\\*\\d\\*\\))");
			Matcher mName = pName.matcher(message);
			Pattern pMoney = Pattern.compile("\\d{1,2}:\\d{1,2}\\s+/\\s*(\\d*,*\\d*,*\\d*,*\\d)원");
			Matcher mMoney = pMoney.matcher(message);
			Pattern pDate = Pattern.compile("([\\d]{2}[/][\\d]{2})");
			Matcher mDate = pDate.matcher(message);
			Pattern pMemo = Pattern.compile("\\d원/.*/\\s+(.+)");
			Matcher mMemo = pMemo.matcher(message);
			Pattern pMemo2 = Pattern.compile("\\d*,*\\d*,*\\d*,*\\d원/\\s*,\\s*\\d*,*\\d*,*\\d*,*\\d원/(.+$)");
			Matcher mMemo2 = pMemo2.matcher(message);
			Pattern pMemo3 = Pattern.compile("\\d원.+/.*/\\s+(.+)");
			Matcher mMemo3 = pMemo3.matcher(message);
			
			if (mName.find())
			{
				for (int i=0; i<mName.groupCount(); i++) 
				{
					data.setName(data.getName() + (mName.group(1)));
				}
			}
			else
			{
				available = false;
				return;
			}
			
			if (mMoney.find()) 
			{
				for (int i=0; i<mMoney.groupCount(); i++) 
				{
					data.setMoney((mMoney.group(1).replaceAll(",", "")));
				}
			}
			else
			{
				available = false;
				return;
			}
			
			Calendar calendar = Calendar.getInstance();
			if (date != null && date.length() > 0)
			{
				data.setDate(date);
			} 
			else if (mDate.find()) 
			{
				for (int i=0; i<mDate.groupCount(); i++) 
				{
					data.setDate(calendar.get(Calendar.YEAR)+(mDate.group(1).replaceAll("/", "")));
				}
			}
			else
			{
				data.setDate(BDUtil.getDateDB(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH)+1, calendar.get(Calendar.DAY_OF_MONTH)));
				//originalParsing();
			}
			
			if (mMemo.find()) 
			{
				for (int i=0; i<mMemo.groupCount(); i++) 
				{
					data.setMemo1((mMemo.group(1)));
					data.setMemo2((mMemo.group(1)));
					data.setMemo3((mMemo.group(1)));
					data.setMemo4((mMemo.group(1)));
				}
			}
			else if (mMemo2.find()) 
			{
				for (int i=0; i<mMemo2.groupCount(); i++) 
				{
					data.setMemo1((mMemo2.group(1)));
					data.setMemo2((mMemo2.group(1)));
					data.setMemo3((mMemo2.group(1)));
					data.setMemo4((mMemo2.group(1)));
				}
			}
			else if (mMemo3.find()) 
			{
				for (int i=0; i<mMemo3.groupCount(); i++) 
				{
					data.setMemo1((mMemo3.group(1)));
					data.setMemo2((mMemo3.group(1)));
					data.setMemo3((mMemo3.group(1)));
					data.setMemo4((mMemo3.group(1)));
				}
			}
			else
			{
				available = false;
				return;
			}
			
			available = true;
		}
		else if ( (data.getName().equalsIgnoreCase("하나은행")) || (data.getName().equalsIgnoreCase("하나")) ) 
		{
			/*
			 * 하나,08/13,11:10
				246******98407
				출금120,000원
				김건중
				잔액0원
				
				하나,08/13,11:10
				246******98407
				출금120,000원
				김건중
				잔액0원
				
				하나,09/19,17:29
				701******20505
				출금10,000원
				ＡＴＭ
				잔액8,968원
				
				하나,02/04,11:59
				141******65707
				출금11,200원
				파리바게뜨화정
			 */
			Pattern pName = Pattern.compile("\\d{2}:\\d{2}\\s+(.+)\\s+출금");
			Matcher mName = pName.matcher(message);
			Pattern pMoney = Pattern.compile("출금(\\d*,*\\d*,*\\d*,*\\d)원");
			Matcher mMoney = pMoney.matcher(message);
			Pattern pDate = Pattern.compile("([\\d]{2}[/][\\d]{2})");
			Matcher mDate = pDate.matcher(message);
			Pattern pMemo = Pattern.compile("출금\\d*,*\\d*,*\\d*,*\\d원\\s+(.+)\\s+잔액");
			Matcher mMemo = pMemo.matcher(message);
			Pattern pMemo2 = Pattern.compile("출금\\d*,*\\d*,*\\d*,*\\d원\\s+(.+$)");
			Matcher mMemo2 = pMemo2.matcher(message);
			
			if (mName.find())
			{
				for (int i=0; i<mName.groupCount(); i++) 
				{
					data.setName("하나" + "(" + (mName.group(1)) + ")");
				}
			}
			else
			{
				available = false;
				return;
			}
			
			if (mMoney.find()) 
			{
				for (int i=0; i<mMoney.groupCount(); i++) 
				{
					data.setMoney((mMoney.group(1).replaceAll(",", "")));
				}
			}
			else
			{
				available = false;
				return;
			}
			
			Calendar calendar = Calendar.getInstance();
			if (date != null && date.length() > 0)
			{
				data.setDate(date);
			} 
			else if (mDate.find()) 
			{
				for (int i=0; i<mDate.groupCount(); i++) 
				{
					data.setDate(calendar.get(Calendar.YEAR)+(mDate.group(1).replaceAll("/", "")));
				}
			}
			else
			{
				data.setDate(BDUtil.getDateDB(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH)+1, calendar.get(Calendar.DAY_OF_MONTH)));
			}
			
			if (mMemo.find()) 
			{
				for (int i=0; i<mMemo.groupCount(); i++) 
				{
					Pattern pMemo3 = Pattern.compile("ＡＴＭ");
					Matcher mMemo3 = pMemo3.matcher(mMemo.group(1));
					
					if (mMemo3.find())
					{
						data.setMemo1("현금 출금");
						data.setMemo2("현금 출금");
						data.setMemo3("현금 출금");
						data.setMemo4("현금 출금");
						
						smsType = BDConstents.OUT_ATM_SMS;
					}
					else
					{
						data.setMemo1((mMemo.group(1)));
						data.setMemo2((mMemo.group(1)));
						data.setMemo3((mMemo.group(1)));
						data.setMemo4((mMemo.group(1)));
					}
				}
			}
			else if (mMemo2.find()) 
			{
				for (int i=0; i<mMemo2.groupCount(); i++) 
				{
					data.setMemo1(mMemo2.group(1));
					data.setMemo2(mMemo2.group(1));
					data.setMemo3(mMemo2.group(1));
					data.setMemo4(mMemo2.group(1));
				}
			}
			else
			{
				available = false;
				return;
			}
			
			available = true;
		}
		else if (data.getName().equalsIgnoreCase("현대백화점카드"))
		{
			/*
			 * [현대백화점카드]07/03,14:10,본인,미아점,계란류 20,338원 일시불 승인
			 */
//			Pattern pName = Pattern.compile("(\\(\\d\\*\\d\\*\\))");
//			Matcher mName = pName.matcher(message);
			Pattern pMoney = Pattern.compile("\\s+(\\d*,*\\d*,*\\d*,*\\d)원");
			Matcher mMoney = pMoney.matcher(message);
			Pattern pDate = Pattern.compile("(\\d{1,2}/\\d{1,2})");
			Matcher mDate = pDate.matcher(message);
			Pattern pMemo = Pattern.compile("\\d{1,2}:\\d{1,2},(.+)\\s+\\d*,*\\d*,*\\d*,*\\d원");
			Matcher mMemo = pMemo.matcher(message);
			
//			if (mName.find())
//			{
//				for (int i=0; i<mName.groupCount(); i++) 
//				{
					data.setName("현대백화점카드");
//				}
//			}
//			else
//			{
//				available = false;
//				return;
//			}
			
			if (mMoney.find()) 
			{
				for (int i=0; i<mMoney.groupCount(); i++) 
				{
					data.setMoney((mMoney.group(1).replaceAll(",", "")));
				}
			}
			else
			{
				available = false;
				return;
			}
			
			Calendar calendar = Calendar.getInstance();
			if (date != null && date.length() > 0)
			{
				data.setDate(date);
			} 
			else if (mDate.find()) 
			{
				for (int i=0; i<mDate.groupCount(); i++) 
				{
					data.setDate(calendar.get(Calendar.YEAR)+(mDate.group(1).replaceAll("/", "")));
				}
			}
			else
			{
				data.setDate(BDUtil.getDateDB(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH)+1, calendar.get(Calendar.DAY_OF_MONTH)));
			}
			
			if (mMemo.find()) 
			{
				for (int i=0; i<mMemo.groupCount(); i++) 
				{
					data.setMemo1((mMemo.group(1)));
					data.setMemo2((mMemo.group(1)));
					data.setMemo3((mMemo.group(1)));
					data.setMemo4((mMemo.group(1)));
				}
			}
			else
			{
				available = false;
				return;
			}
			
			available = true;
		}
		

		if (data.getName() == null || data.getName().equalsIgnoreCase(""))
		{
			SmsOutMoney3 som3 = new SmsOutMoney3(data, message, date, smsType, checkcreditFlag);
			this.data = som3.getData();
			this.smsType = som3.getSmsType();
			this.available = som3.getAvailable();
		}
		if (data.getDate() == null || data.getDate().equalsIgnoreCase(""))
		{
			SmsOutMoney3 som3 = new SmsOutMoney3(data, message, date, smsType, checkcreditFlag);
			this.data = som3.getData();
			this.smsType = som3.getSmsType();
			this.available = som3.getAvailable();
		}
		if (data.getMoney() == null || data.getMoney().equalsIgnoreCase(""))
		{
			SmsOutMoney3 som3 = new SmsOutMoney3(data, message, date, smsType, checkcreditFlag);
			this.data = som3.getData();
			this.smsType = som3.getSmsType();
			this.available = som3.getAvailable();
		}
		if ( (data.getMemo1() == null) || (data.getMemo1().equalsIgnoreCase("")) 
				&& ( (data.getMemo2() == null) || (data.getMemo2().equalsIgnoreCase("")) )
				&& ( (data.getMemo3() == null) || (data.getMemo3().equalsIgnoreCase("")) )
				&& ( (data.getMemo4() == null) || (data.getMemo4().equalsIgnoreCase("")) ) )
		{
			SmsOutMoney3 som3 = new SmsOutMoney3(data, message, date, smsType, checkcreditFlag);
			this.data = som3.getData();
			this.smsType = som3.getSmsType();
			this.available = som3.getAvailable();
		}
		if (data.getName() == null || data.getName().equalsIgnoreCase("") 
				|| data.getDate() == null || data.getDate().equalsIgnoreCase("") 
				|| data.getMoney() == null || data.getMoney().equalsIgnoreCase("")
				|| ( data.getMemo1() == null || data.getMemo1().equalsIgnoreCase("") 
				&& data.getMemo2() == null || data.getMemo2().equalsIgnoreCase("")
				&& data.getMemo3() == null || data.getMemo3().equalsIgnoreCase("")
				&& data.getMemo4() == null || data.getMemo4().equalsIgnoreCase("") ) )
		{
			this.available = false;
			return;
		}
	}
}
